diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-29 08:01:53 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-09-29 08:01:53 +0000 |
| commit | c7d37ec3e60c9197abc79738316ddae7c5bf8817 (patch) | |
| tree | 9b045c7b7302d55f43d76565aa4fd5c6dd3a097b /app/[lng]/evcp/(evcp)/(eng)/vendor-data/layout.tsx | |
| parent | 82a2ce067c9b690cdf7775dfb0be94583f51ca29 (diff) | |
(대표님) 그룹라우터로 앱라우터 경로 정리
Diffstat (limited to 'app/[lng]/evcp/(evcp)/(eng)/vendor-data/layout.tsx')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/(eng)/vendor-data/layout.tsx | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/(eng)/vendor-data/layout.tsx b/app/[lng]/evcp/(evcp)/(eng)/vendor-data/layout.tsx new file mode 100644 index 00000000..7d00359c --- /dev/null +++ b/app/[lng]/evcp/(evcp)/(eng)/vendor-data/layout.tsx @@ -0,0 +1,67 @@ +// app/vendor-data/layout.tsx +import * as React from "react" +import { cookies } from "next/headers" +import { Shell } from "@/components/shell" +import { getVendorProjectsAndContracts } from "@/lib/vendor-data/services" +import { VendorDataContainer } from "@/components/vendor-data/vendor-data-container" +import { InformationButton } from "@/components/information/information-button" +// Layout 컴포넌트는 서버 컴포넌트입니다 +export default async function VendorDataLayout({ + children, +}: { + children: React.ReactNode +}) { + // evcp: 전체 계약 대상으로 프로젝트 데이터 가져오기 + const projects = await getVendorProjectsAndContracts() + + // 레이아웃 설정 쿠키 가져오기 + // Next.js 15에서는 cookies()가 Promise를 반환하므로 await 사용 + const cookieStore = await cookies() + + // 이제 cookieStore.get() 메서드 사용 가능 + const layout = cookieStore.get("react-resizable-panels:layout:mail") + const collapsed = cookieStore.get("react-resizable-panels:collapsed") + + const defaultLayout = layout ? JSON.parse(layout.value) : undefined + const defaultCollapsed = collapsed ? JSON.parse(collapsed.value) : undefined + + return ( + <Shell className="gap-2"> + <div className="flex items-center justify-between space-y-2"> + <div className="flex items-center justify-between space-y-2"> + <div> + <div className="flex items-center gap-2"> + <h2 className="text-2xl font-bold tracking-tight"> + 협력업체 데이터 입력 + </h2> + <InformationButton pagePath="partners/vendor-data" /> + </div> + {/* <p className="text-muted-foreground"> + 각종 Data 입력할 수 있습니다 + </p> */} + </div> + </div> + </div> + + <section className="overflow-hidden rounded-[0.5rem] border bg-background shadow"> + <div className="hidden flex-col md:flex"> + {projects.length === 0 ? ( + <div className="p-4 text-center text-sm text-muted-foreground"> + No projects found for this vendor. + </div> + ) : ( + <VendorDataContainer + projects={projects} + defaultLayout={defaultLayout} + defaultCollapsed={defaultCollapsed} + navCollapsedSize={4} + > + {/* 페이지별 콘텐츠가 여기에 들어갑니다 */} + {children} + </VendorDataContainer> + )} + </div> + </section> + </Shell> + ) +}
\ No newline at end of file |
